cpuid_edx(0x8000000A) : 0);
svm_function_table.hap_supported = cpu_has_svm_npt;
+ svm_function_table.hap_1gb_pgtb =
+ (CONFIG_PAGING_LEVELS == 4)? !!(cpuid_edx(0x80000001) & 0x04000000):0;
hvm_enable(&svm_function_table);
}
if ( cpu_has_vmx_ept )
vmx_function_table.hap_supported = 1;
+
+ vmx_function_table.hap_1gb_pgtb = 0;
setup_vmcs_dump();
#define P2M_AUDIT 0
#define P2M_DEBUGGING 0
+/* turn on/off 1GB host page table support for hap */
+static int opt_hap_1gb = 0;
+boolean_param("hap_1gb", opt_hap_1gb);
+
/* Printouts */
#define P2M_PRINTK(_f, _a...) \
debugtrace_printk("p2m: %s(): " _f, __func__, ##_a)
while ( todo )
{
if ( is_hvm_domain(d) && paging_mode_hap(d) )
- order = ( (((gfn | mfn_x(mfn) | todo) & ((1ul << 18) - 1)) == 0) ) ?
- 18 :
- (((gfn | mfn_x(mfn) | todo) & ((1ul << 9) - 1)) == 0) ? 9 : 0;
+ order = ( (((gfn | mfn_x(mfn) | todo) & ((1ul << 18) - 1)) == 0) &&
+ hvm_funcs.hap_1gb_pgtb && opt_hap_1gb ) ? 18 :
+ (((gfn | mfn_x(mfn) | todo) & ((1ul << 9) - 1)) == 0) ? 9 : 0;
else
order = 0;
{
struct domain *d = v->domain;
+ /* The following assertion is to make sure we don't step on 1GB host
+ * page support of HVM guest. */
+ ASSERT(!(level > 2 && (l1e_get_flags(*p) & _PAGE_PRESENT) &&
+ (l1e_get_flags(*p) & _PAGE_PSE)));
+
/* If we're removing an MFN from the p2m, remove it from the shadows too */
if ( level == 1 )
{
/* Support Hardware-Assisted Paging? */
int hap_supported;
+ /* Support 1GB Harware-Assisted Paging? */
+ int hap_1gb_pgtb;
+
+
/*
* Initialise/destroy HVM domain/vcpu resources
*/